import { CrossGuildWarModule } from "../CrossGuildWarModule";
import { CrossGuildWarModuleTabIndex } from "../data/CrossGuildWarModuleTabIndex";
import { CrossGuildWarCache } from "../../../cache/CrossGuildWarCache";
import { Cache } from "../../../cache/Cache";
import { CrossGuildWarScheduleBase } from "../subWin/base/CrossGuildWarScheduleBase";
import { GameProxy } from "../../../mvc/GameProxy";
//class CrossGuildWarModuleShowControlCenter
    
    export  class CrossGuildWarModuleShowControlCenter
    {
        constructor(arg1: CrossGuildWarModule)
        {
            
            this._module = arg1;
            return;
        }

        public moduleTabChangedHandler(): void
        {
            if (this._module == null) 
            {
                return;
            }
            var loc1=this._module.getTabSelected();
            var loc2=loc1;
            switch (loc2) 
            {
                case CrossGuildWarModuleTabIndex.chooseEnemy:
                {
                    this.checkAndShowChooseEnemy();
                    break;
                }
                case CrossGuildWarModuleTabIndex.scheduleRank:
                {
                    this.checkAndShowResult();
                    break;
                }
            }
            return;
        }

        /* internal  */get cache(): CrossGuildWarCache
        {
            return Cache.instance.crossGuildWar;
        }

        /* internal  */checkAndShowChooseEnemy(): void
        {
            this._module.showChooseForTopWin();
            return;
        }

        /* internal  */checkAndShowResult(): void
        {
            var loc1=this._module.getRankCurPage();
            var loc2=CrossGuildWarScheduleBase.PageSize;
            GameProxy.copy.crossGuildWarGetRankInfos(loc1, loc2);
            return;
        }

        /* internal */ /* var */_module: CrossGuildWarModule;
    }
